package com.kexio.sms.enums;

/**
 * 短信服务提供商枚举
 * 
 * @author Kexio Team
 * @since 1.0.0
 */
public enum SmsProvider {
    
    /**
     * 阿里云短信
     */
    ALIYUN("aliyun", "阿里云短信"),
    
    /**
     * 腾讯云短信
     */
    TENCENT("tencent", "腾讯云短信"),
    
    /**
     * 华为云短信
     */
    HUAWEI("huawei", "华为云短信"),
    
    /**
     * 京东云短信
     */
    JDCLOUD("jdcloud", "京东云短信"),
    
    /**
     * 百度云短信
     */
    BAIDU("baidu", "百度云短信"),
    
    /**
     * 火山引擎短信
     */
    VOLCENGINE("volcengine", "火山引擎短信");
    
    private final String code;
    private final String description;
    
    SmsProvider(String code, String description) {
        this.code = code;
        this.description = description;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 根据代码获取枚举
     */
    public static SmsProvider fromCode(String code) {
        for (SmsProvider provider : values()) {
            if (provider.getCode().equals(code)) {
                return provider;
            }
        }
        throw new IllegalArgumentException("Unknown SMS provider code: " + code);
    }
}
